package net.stogi.dsper.ui.client.module.datasource;

import java.util.List;

import net.stogi.dsper.api.dto.DataSourceDto;

import com.google.gwt.event.shared.GwtEvent;

public class DataSourcesSelectedEvent extends GwtEvent<DataSourcesSelectedHandler> {

	public static final GwtEvent.Type<DataSourcesSelectedHandler> TYPE = new GwtEvent.Type<DataSourcesSelectedHandler>();

	private List<DataSourceDto> selectedDataSources;

	public DataSourcesSelectedEvent(List<DataSourceDto> selectedDataSources) {
		this.selectedDataSources = selectedDataSources;
	}

	@SuppressWarnings("unused")
	private DataSourcesSelectedEvent() {}

	@Override
	public Type<DataSourcesSelectedHandler> getAssociatedType() {
		return TYPE;
	}

	/**
	 * @return the selectedDataSources
	 */
	public List<DataSourceDto> getSelectedDataSources() {
		return selectedDataSources;
	}

	/**
	 * @param selectedDataSources
	 *            the selectedDataSources to set
	 */
	public void setSelectedDataSources(List<DataSourceDto> selectedDataSources) {
		this.selectedDataSources = selectedDataSources;
	}

	@Override
	protected void dispatch(DataSourcesSelectedHandler handler) {
		handler.onDataSourcesSelected(this);
	}
}
